package org.jetlinks.community.auth.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.hswebframework.web.dict.EnumDict;

@Getter
@AllArgsConstructor
public enum OrgType   implements EnumDict<String> {

    system("系统默认"),
    project("项目"),
    site("站点"),
    group("分组");

    private final String text;

    @Override
    public String getValue() {
        return name();
    }

    public static OrgType of(String type) {
        switch (type){
            case "project":
                return project;
            case "site":
                return site;
            case "group":
                return group;
            case "system":
            default:
                return system;
        }
    }
}